Plex.Lib.JS.load('Data.Jax');
Plex.Lib.JS.load('Data.XT');
Plex.Lib.JS.load('Com.Navigation');
Plex.Lib.JS.load('UI.Page.Stage');
Plex.Lib.JS.load('UI.Button.Picture');

Plex.Com.Module[11] = function(pageInfo)
{
	var self = this;

	this.info = pageInfo;
	this.page = new Plex.UI.Page.Stage();

	this.dndAction = stageAction=function(obj,realobj,ev)
	{
		if(realobj.parentNode!=Self.page.body)
		{
			if(ev.ctrlKey || ev.altKey)
			copy_button(realobj.pn,Self)
			else
			move_button(realobj.pn,Self);
		}
		else
		{
			var siblings=Self.page.body.childNodes, before=false, MO=Button_DND.mouseOffset, OO=Button_DND.offset(obj);
			var X=MO.x+OO.x,	Y=MO.y+OO.y;

			for(i=0;i<siblings.length;i++)
			{
				var sibling=siblings[i];
				var P=Button_DND.offset(sibling), W=parseInt(sibling.offsetWidth), H=parseInt(sibling.offsetHeight);
				var x1=P.x, x2=P.x+W, y1=P.y, y2=P.y+H;
				if(	(X>x1)	&&	(X<x2)	&&	(Y>y1)	&&	(Y<y2)	){	before=i+1;break;}
			}

			if(!before)
			{

				nf_A(Self.page.body,realobj);
				db("Moving Button "+realobj.pn.navigation_map_ID+" To Last Position On Page "+Self.page_ID);
			}
			else
			{
				nf_IB(Self.page.body.childNodes.item(before-1),realobj);
				db("Moving Button "+realobj.pn.navigation_map_ID+" To Position "+(before)+" On Page "+Self.page_ID);
			}
		}
	}

	Plex.Com.Navigation.configure(this,this.page.body,Plex.UI.Button.Picture);

	this.navigation.onLoad = function(obj,realObj,ev)
	{
		//		Button_DND.addTarget(self.page.body,self.dndAction);
	}

	Plex.Com.Navigation.load(this);
	Plex.Com.Page.register(this);
	
	self.open();
}